/*
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-13 09:42:34
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2024-12-13 15:56:59
 * @FilePath: \hbzc-groupmeal-center-web\src\utils\upperLetter.ts
 */
import pinyin from 'js-pinyin'


// 设置汉字转拼音的选项
pinyin.setOptions({
  checkPolyphone: false,
  charCase: 1 // 设置首字母大写
});

// 输出大写首字母
export const upperLetter = (text: string) => {
  return pinyin.getCamelChars(text).replace(/[^a-zA-Z0-9]/g, "").toUpperCase()
}

